import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index/index'
import Login from '@/components/login/login'

import SearchList from '@/components/searchList/searchList'
import Articles from '@/components/articles/articles'
import ArticleDetail from '@/components/articles/articleDetail'
import AuthorDetail from '@/components/articles/authorDetail'
import Discounts from '@/components/discounts/discounts'
import GoodsList from '@/components/goodsList/goodsList'
import ShopFind from '@/components/shopFind/shopFind'
import ShopFindJD from '@/components/shopFindJD/shopFindJD'
import GoodDetail from '@/components/goodDetail/goodDetail'
import Selection from '@/components/selection/selection'
import CateSelection from '@/components/cateSelection/cateSelection'
import BrandSelection from '@/components/brandSelection/brandSelection'
import SlecAddress from '@/components/slecAddress/slecAddress'
import NewAddress from '@/components/newAddress/newAddress'

// const SearchList=(resolve)=>{
//   import ('@/components/searchList/searchList').then((searchList)=>{
//     resolve(searchList)
//   })
// }
// const Articles=(resolve)=>{
//   import ('@/components/searchList/searchList').then((articles)=>{
//     resolve(articles)
//   })
// }
// const ArticleDetail=(resolve)=>{
//   import ('@/components/searchList/searchList').then((articleDetail)=>{
//     resolve(articleDetail)
//   })
// }
// const AuthorDetail=(resolve)=>{
//   import ('@/components/searchList/searchList').then((authorDetail)=>{
//     resolve(authorDetail)
//   })
// }
// const Discounts=(resolve)=>{
//   import ('@/components/searchList/searchList').then((discounts)=>{
//     resolve(discounts)
//   })
// }
// const GoodsList=(resolve)=>{
//   import ('@/components/searchList/searchList').then((goodsList)=>{
//     resolve(goodsList)
//   })
// }




Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/index',
      name: 'index',
      component: index,
    },
    {
      path: '/discounts',
      name: 'discounts',
      component: Discounts,
    },
    {
      path: '/goodsList',
      name: 'goodsList',
      component: GoodsList,
    },
    {
      path: '/selection',
      name: 'selection',
      component: Selection,
    },
    {
      path: '/cateSelection',
      name: 'cateSelection',
      component: CateSelection,
    },
    {
      path: '/brandSelection',
      name: 'brandSelection',
      component: BrandSelection,
    },
    {
      path: '/slecAddress',
      name: 'slecAddress',
      component: SlecAddress,
    },
    {
      path: '/newAddress',
      name: 'newAddress',
      component: NewAddress,
    },
    {
      path: '/goodDetail',
      name: 'goodDetail',
      component: GoodDetail,
    },
    {
      path: '/shopFind',
      name: 'shopFind',
      component: ShopFind,
    },
    {
      path: '/shopFindJD',
      name: 'shopFindJD',
      component: ShopFindJD,
    },
    {
      path: '/searchList',
      name: 'searchList',
      component: SearchList
    },
    {
      path: '/articles',
      name: 'articles',
      component: Articles,
    },
    {
      path: '/articleDetail',
      name: 'articleDetail',
      component: ArticleDetail
    },
    {
      path: '/authorDetail',
      name: 'authorDetail',
      component: AuthorDetail
    }
  ]
})
